home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-03-30 | 2.7 KB | 61 lines | [TEXT/KAHL] |
- Some Explanatory Notes for the Sources of lpDaemon
- ==================================================
-
- Firstly, unless otherwise stated all sources are the work of Casper A. Boon who
- holds the copyright to same. Sources are provided "as is" and no claim is made
- as to the suitability for any purpose.
-
- Now that that is over and done with, the processing in lpDaemon is based around
- the typical Macintosh event loop. The code in BackGrounder.C is used to maintain
- access to the event loop while waiting for asychronous calls to complete. The
- usual way this is used is for asychronous device manager calls where the ioResult
- field is used to detirmine when the call is complete.
-
- There are three main routines in the backgrounding :
-
- Ptr Background(integer *flag, CallBackProcPtr proc, Ptr param);
- Ptr Timeout(integer *flag, CallBackProcPtr proc, Ptr param, LongInt timeout);
-
- void RunBackground(void);
-
- When an asychronous call is made either Background or Timeout is used to add to the
- background queue. The flag would be the ioResult field. The proc will be a routine
- to call when the value at flag is <= 0. The param field is a parameter to be passed
- to the proc and is usually a pointer to a record structure. The timeout value may be
- given as the number of ticks before the call "times out" and proc is called anyway.
- The CallBackProc would not be run at interrupt time and so is not restricted in the
- same way that the CompletionProc is. It will be a routine of the form :
-
- void CallBackProc(integer flag, Ptr param);
-
- The flag that is passed is the dereferenced flag pointer passed to the backgrounder
- but may still be > 0 which indicates that a timeout has occurred. This is
- useful for spinning cursors etc without killing the asynchronous call.
-
- The RunBackground routine is called in the main event loop. It runs down a queue of
- background tasks and checks the dereferenced flags looking for completed calls (when
- the value is <= 0 the call is thought to be complete) and checks the timeouts looking
- for timed out calls. If a background task has completed or timed out it is removed
- from the background queue and the callback routine is called.
-
-
- The PAP interface code
- ======================
- With thanks to Mike Schuster whose article in MacTutor showed how to access the PAP
- code in the LaserWriter. Also thanks to the CAP team for their PAP code and
- printer access code.
-
-
-
- Text to PostScript conversion
- =============================
- An extra file textps.c is included which is a modified version of the textps.c from the
- unix lprps package by James Clark (jjc@jclark.com) To enable the text to postscript
- conversion just add :
-
- #define TEXTPS
-
- to the prefix option in the THINK project. This has not been tested since it was
- re-introduced in this release so, you are on your own.
-
-